package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseDemo {
    public static void main(String[] args) {
        System.out.println("开始了");
        try(FileOutputStream fos=new FileOutputStream("a/d/txt.txt");
        ){
fos.write(1);
        }catch (IOException e){
            System.out.println("解决了问题");
        }
        System.out.println("结束");
    }
}
